<%--系统管理员登陆后看到所有笔记的界面--%>
<%@ page import="dao.Imp_Sysmanage" %>
<%@ page import="pojo.Note" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: tangms
  Date: 2022/4/2
  Time: 8:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }
        .title_left{
            margin-left: 420px;
        }
        .content_left{
            border:1px solid black;
            width: 440px;
            margin-left: 420px;
            height: 100px;
            margin-bottom: 20px;
        }
        .delete{
            margin-left: 790px;
        }
        .type{
            margin-left: 420px;
        }
    </style>
    <script>
        function deleteNote(id){
            if(confirm("您确定删除吗？")){
                location.href="${pageContext.request.contextPath}/delForSysServlet?id="+id;
            }
        }
    </script>
</head>
<body>
<h3 align="center">所有笔记</h3>
<%
    Imp_Sysmanage imp_sysmanage=new Imp_Sysmanage();
    ArrayList<Note> listnotes=imp_sysmanage.allnotes();
    request.setAttribute("listnotes",listnotes);

%>
<c:forEach items="${listnotes}" var="note" varStatus="s">
    <c:if test="${note.style==1}">
    <form>
        <table>
            <tr>
                <td>
                    <h5 class="title_left">${note.title}</h5>
                    <h5 class="type">${note.type}</h5>
                    <a href="javascript:deleteNote(${note.id});" class="delete" type="submit">删除</a>
                    <p class="content_left">${note.content}</p>
                </td>
            </tr>
        </table>
    </form>
    </c:if>
</c:forEach>
</body>
</html>
